package com.matrix.draft.juc.day6;


import com.matrix.draft.juc.util.JucUtil;

public class CopyOnWriteXXX {
    public static void main(String[] args) throws Exception {
        Thread t1 = new Thread(() -> {
            while (true) {
                JucUtil.sleep(1000);
                System.out.println("do...");
            }
        });
        t1.start();
        JucUtil.sleep(3000);
        t1.wait(); // 汇报错illegalMonitorStateException, 因为调用wait()的对象必须作为锁对象,一般需要搭配synchronized
    }
}
